<template>
    <div>
  <p>你要购买商品的数量为:{{counst}}</p>
  <button v-on:click=addFn>点击此按钮加一</button>
  <button @click=addcounstFn(5)>点击此按钮加五</button>
  <button @click=subFn>点击此按钮减一</button>
    </div>
</template>

<script>
export default {
    name: 'VuecliTwo01',

    data() {
        return {
       counst:0
        }
        },
     

    mounted() {
        
    },

    methods: {
      addFn(){
        this.counst++
      },
      addcounstFn(n){
        this.counst+=n
      },
      subFn(){
        this.counst--
      }
        
    },
};
</script>

<style lang="scss" scoped>

</style>